const net = require('net')

// 创建服务端
let server = net.createServer()
server.listen(1234, ()=>{
  console.log('服务端启动了')
})

server.on('connection', (socket)=>{
  socket.on('data', (data)=>{
    console.log('服务端接收数据', data.toString())
  })
})
